@extends('admin.common.zhyframe')

@section('head')
@endsection

@section('content')
<div class="container mt-50">
	<div class="row">
		<div class="col-sm-12">
			<form class="form-horizontal" role="form" id="usergroupInfoForm">
				<div class="form-group">
					<label class="col-sm-2 control-label">管理员组名称：</label>
					<div class="col-sm-8">
						<input type="text" class="form-control" name="usergroup_name" value="{{$usergroupinfo->usergroup_name}}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label ftz-20">管理员组权限：</label>
					<div class="col-sm-8">
						@foreach($permission as $key => $val)
							<span class="mb-5">【{{$val['groupname']}}】</span>
							<div class="checkbox mb-10 ml-40">
								@foreach($val['groupsons'] as $k => $per)
								<label class="pl-0 mr-20">
									<input name="usergroup_permission[]" type="checkbox" class="input-checkbox" value="{{$per->controller_action}}"
									@if(strrpos($usergroupinfo->usergroup_permission,$per->controller_action) !==false ) checked @endif><i class="mr-5">✓</i>{{$per->permission_name}}
								</label>
								@endforeach
							</div>
						@endforeach
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注信息：</label>
					<div class="col-sm-8">
						<textarea class="form-control" rows="3" name="adminremark">{{$usergroupinfo->adminremark}}</textarea>
					</div>
				</div>
				<div class="form-group mt-50">
					<div class="col-sm-4 col-sm-offset-5 ">
						<span class="btn btn-primary" onclick="layAjaxForm($('#usergroupInfoForm').serialize(), '/admin/usergroup/editsave/{{$usergroupinfo->usergroup_id}}', 'post')">保&nbsp;&nbsp;存</span>
						<span class="btn btn-white ml-15" onclick="layClose()">取&nbsp;&nbsp;消</span>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
@endsection

@section('footer')
<script src="{{asset('js/public.js')}}"></script>
@endsection